#! /usr/bin/env python
#coding:utf-8
#paramiko test!
""" demo.py command
"""

import paramiko
import os,sys

host='42.121.113.43'
user='root'
password='sharev@WH2013'


s=paramiko.SSHClient()  #bind instance
s.load_system_host_keys()
#s.set_missing_host_key_policy(paramiko.AutoAddPolicy())

t=paramiko.Transport((host,22))
t.connect(username=user,password=password)
sftp=paramiko.SFTPClient.from_transport(t)
#get files from remote server;
#sftp.get('/root/ez_setup.py','/tmp/ez.py'ls -l )
#put local file to remote server;
sftp.put('/home/guolt/test.py','/root/test.py')
s.close()